package com.two;
import com.wuzhihai.first.helloward;
import java.util.Scanner;

public class MovieTest {
    public static void main(String[] args) {
        helloward de=new helloward();
        de.demo();
        Movie[] movies=new Movie[4];
        movies[0]=new Movie("水门桥",1,38.9,9.8,"徐克","吴京","18万人想看");
        movies[1]=new Movie("出拳吧",2,39,7.8,"唐晓白","田雨","3.5万人想看");
        movies[2]=new Movie("月球陨落",3,42,7.9,"罗兰","贝瑞","17.9万人想看");
        movies[3]=new Movie("一点就到家",4,35,8.7,"许宏宇","刘昊然","10.8万人想看");

        //创建一个电影的操作类对象，接受电影数据，并对其进行业务处理
        MocieOperator operator=new MocieOperator(movies);
       // operator.printAllMovies();
        //operator.searchMovies(2);
        int zhix=1;
        Scanner sc = new Scanner(System.in);
        while (zhix==1) {
            System.out.println("==电影信息系统==");
            System.out.println("1.查询全部电影信息");
            System.out.println("2.根据id查询某个电影的详细信息展示");
            System.out.println("3退出系统");
            System.out.println("请你输入操作");

            int command = sc.nextInt();
            switch (command) {
                case 1:
                    operator.printAllMovies();
                    break;
                case 2:
                    System.out.println("请输入您想查询的电影id");
                    command = sc.nextInt();
                    operator.searchMovies(command);
                    break;
                case 3:
                    zhix=0;
                    System.out.println("操作系统已关闭");
                    break;
                default:
                    System.out.println("请重新选择");
                    break;
            }

        }sc.close();
    }
}
